<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>我的</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/main.css" />
		<style>
			#head-img {
				max-width: 70px;
				height: 70px;
				margin-top: 0.3rem;
				border-radius: 40%;
			}
			
			#gerenzhongxin .mui-media-body {
				font-size: 0.3751rem;
				padding-left: 10px;
			}
			
			.firstUl {
				margin-top: 0.08rem;
			}
			
			.mui-navigate-right:after {
				font-size: 0.5rem;
				color: #E0E0E0;
				right: 0;
			}
			
			#table-viewX {
				font-size: 0.2916rem;
				/*margin-bottom: 0.08rem;*/
			}
			
			#table-viewX img {
				width: 0.65rem;
				height: 0.65rem;
			}
			
			#table-viewX .mui-media-body {
				margin-top: 0.15rem;
				width: 90%;
				float: left;
				font-size: 15px;
				padding-left: 10px;
			}
			
			.mui-pull-right {
				margin-right: 25px;
			}
			
			.mui-btn {
				border-radius: 0;
				font-size: 0.3126rem;
				color: #1d1d1d;
			}
			
			.mui-content-padded {
				margin: 0;
			}
			
			.mui-table-view:before {
				height: 1px;
				background-color: #ececec;
			}
			
			.mui-table-view-cell>a:not(.mui-btn).mui-active {
				background-color: transparent;
			}
			
			.mui-table-view-cell:after {
				left: 0;
			}
			
			.tubiao {
				width: 10%;
				float: left;
			}
			
			.wrz {
				width: 20px;
				height: 20px;
				float: left;
			}
			
			.renzheng img {
				margin-top: 8%;
			}
			
			.renzheng #isshiming {
				margin-top: 8%;
			}
			
			#head-img-button {
				max-width: 1.54rem;
				height: 0.58rem;
				margin-right: 1%;
			}
			
			.change_name {
				font-size: 0.28rem;
				font-weight: 700;
				color: #333;
			}
			
			.jiahu_num {
				font-size: 0.28rem;
				font-weight: 700;
				color: #333;
				margin: 2% 0 4% 0;
			}
			
			.jiahu_two {
				margin-top: 2%;
			}
			
			.qrz_one {
				width: 30%;
				float: right;
			}
			
			.mui-table-view-cell>a:not(.mui-btn) {
				position: relative;
				display: block;
				overflow: hidden;
				margin: -11px -15px;
				padding: 4% 4% 4% 4%;
				white-space: nowrap;
				text-overflow: ellipsis;
				color: inherit;
			}
			
			.heart_red img {
				width: 5%;
			}
			
			@-webkit-keyframes fadeIn {
				0% {
					opacity: 0
				}
				100% {
					opacity: 1
				}
			}
			
			@keyframes fadeIn {
				0% {
					opacity: 0
				}
				100% {
					opacity: 1
				}
			}
			
			.img-lazyload {
				-webkit-animation: fadeIn 350ms linear 0ms 1 normal both;
				animation: fadeIn 350ms linear 0ms 1 normal both;
				opacity: 1;
			}
			
			#head-img {
				width: 70px;
				height: 70px;
				border-radius: 50px;
				margin-top: 10px;
			}
		</style>
	</head>

	<body>
		<div class="mui-content mui-scroll-wrapper" id="content">
			<ul class="mui-table-view mui-table-view-chevron gerenzhongxin" id="gerenzhongxin">
				<li class="mui-table-view-cell mui-media">
					<a class="geren_message" id="geren_message">
						<!--<img   src="../images/wode/tx.png">-->
						<img class="mui-media-object mui-pull-left img-lazyload" id="head-img" src="touxiang.jpg" />
						<div class="mui-media-body" style="position:relative;margin:1% 0">
							<div style="display: inline-block;"><span id="username" class="change_name left"></span></div>
							<div class="renzheng left" style="display: inline-block;position:absolute;top:-3%;left:23%">
								<img class="wrz" src="../images/wode/yrz.png">
								<p class="mui-ellipsis" id="isshiming">未认证</p>
								<p class="mui-ellipsis" id="hospital"></p>
							</div>
							<img class="qrz_one" id="head-img-button" src="../images/qrz.png">
							<div class="jiahu_love">
								<p class="mui-ellipsis jiahu_num" id="isshiming">佳护号：<span class="jiahuNum" id="jiahuNum_one"></span></p>
								<p class="mui-ellipsis jiahu_two" id="hospital">爱心值 ：<span class="heart_red"><img src="../images/mine/aixinzhi2-01.png" alt="" /><span id="" class="heart_red"></span></span> <span id="lovevalue"></span> </p>
							</div>
						</div>
					</a>
				</li>
			</ul>

			<ul class="mui-table-view" id="table-viewX">
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" id="wodehuanzhe">
						<div class="tubiao"><img class="mui-media-object mui-pull-left" src="../images/wode/hzgl.png" /></div>
						<div class="mui-media-body">
							我的患者
						</div>
					</a>

				</li>
			</ul>
			<ul class="mui-table-view" id="table-viewX">
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" id="wodezhanghu">
						<div class="tubiao"><img class="mui-media-object mui-pull-left" src="../images/wode/wdzh.png" /></div>
						<div class="mui-media-body">
							我的账户
							<span class="mui-pull-right" id="qianbao_yue"></span>
						</div>
					</a>
				</li>
			</ul>

			<ul class="mui-table-view" id="table-viewX">
				<li class="mui-table-view-cell">
					<a id="suifangguanli" class="mui-navigate-right">
						<div class="tubiao"><img class="mui-media-object mui-pull-left" src="../images/wode/sfgl.png" /></div>
						<div class="mui-media-body">
							随访管理
						</div>
					</a>
				</li>
			</ul>
			<ul class="mui-table-view" id="table-viewX">
				<li class="mui-table-view-cell">
					<a id="yijian_fankui" class="mui-navigate-right">
						<div class="tubiao"><img class="mui-media-object mui-pull-left" src="../images/wode/yyfk.png" /></div>
						<div class="mui-media-body">
							意见反馈
						</div>
					</a>
				</li>
			</ul>

			<ul class="mui-table-view" id="table-viewX">
				<li class="mui-table-view-cell">
					<a class="mui-navigate-right" id="setting">
						<div class="tubiao"><img class="mui-media-object mui-pull-left" src="../images/wode/sz.png" /></div>
						<div class="mui-media-body">
							设置
						</div>
					</a>
				</li>
			</ul>
			<ul class="mui-table-view" style="margin-top: 25px; margin-bottom: 20px;" id="table-viewX">
				<li class="mui-table-view-cell" id="quit">
					<a style="text-align: center;color: #4a4a4a; font-size: 15px;">
						注销
					</a>
				</li>
			</ul>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/xiangyingshi.js"></script>
	<script type="text/javascript" src="../js/constants.js"></script>
	<script type="text/javascript" src="../js/sharemethods.js"></script>
	<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>

	<script type="text/javascript" src="../plugs/qs/qs.feedback.js"></script>
	<script type="text/javascript" src="../plugs/md5/md5.min.js"></script>
	<script>
		mui.init({});

		mui.plusReady(function() {
			reaload()
			noOnline(user);
			document.getElementById("quit").addEventListener("tap", function() {
				closeApp();
			})
		});
		var user = JSON.parse(localStorage.getItem("USER")); //取user的个人信息值

		var reaload = function() {
			user = JSON.parse(localStorage.getItem("USER")); //取user的个人信息值
			var self = plus.webview.currentWebview();
			var phone = self.phone;
			$("#username").html(user.name);
			$("#jiahuNum_one").html(user.jiahuno);
			$("#lovevalue").html(user.lovevalue)
			var image_url = serverAddress + $$.processImagePath(user.userfaceimage)
			var ele = document.getElementById("head-img");
			ele.setAttribute('data-lazyload',image_url)
			$$.lazyload(ele)
		}

		var noOnline = function(user) {
			//是否实名认证
			$('#username').val(user.name);
			$('#lovevalue').val(user.lovevalue);

			if(user.idapprove == "0") {
				$('#isshiming').text("未认证");
				$("#jiahu_love").hide();
				$('#head-img-button').show();
			} else if(user.idapprove == "1") {
				$('#isshiming').text("待审核 ");
				$(".jiahu_love").hide();
				$("#username").text(user.name);
				$('#head-img-button').hide();

			} else if(user.idapprove == "2") {
				$('#isshiming').text("通过审核 ");
				$("#jiahu_love").show();
				$('#head-img-button').hide();

			} else if(user.idapprove == "3") {
				$('#isshiming').text("未通过审核");
				$("#jiahu_love").hide();
				$('#head-img-button').show();
			}
		}

		var realoadInfo = function() {
			var sussess = function(data) {
				//服务器返回响应，根据响应结果，分析是否登录成功；
				if(data.result == "success") {
					user = data.obj;
					localStorage.setItem('USER', JSON.stringify(data.obj));
					noOnline(user)
				} else {
					mui.toast(data.msg);
				}
			};
			commonHttpUtils(showdetailUrl, "get", {}, sussess, error);
		}

		//去头像按钮
		document.getElementById("head-img").addEventListener("tap", function(e) {
			console.log(000)
			console.log(user.phone)
			mui.openWindow({
				url: '../set/head_touxiang.html',
				id: 'head_touxiang.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				},
			});
		})

		//去认证按钮
		document.getElementById("head-img-button").addEventListener("tap", function(e) {
			mui.openWindow({
				url: '../set/set_real_name.html',
				id: 'set_real_name.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				},
				extras: {
					phone: user.phone //扩展参数    传值电话号向实名认证里
				}
			});
		})

		document.getElementById("wodehuanzhe").addEventListener('tap', function() {
			mui.openWindow({
				url: '../set/set_patients_list.html',
				id: 'set/set_patients_list.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				}
			});
		});

		document.getElementById("suifangguanli").addEventListener('tap', function() {
			mui.openWindow({
				url: '../set/follow_manage.html',
				id: 'set/follow_manage.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				}
			});
		});

		document.getElementById("wodezhanghu").addEventListener('tap', function() {
			mui.openWindow({
				url: '../set/account_setting.html',
				id: 'set/account_setting.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				}
			});
		});

		document.getElementById("yijian_fankui").addEventListener('tap', function() {
			mui.openWindow({
				url: '../set/suggest_one.html',
				id: 'set/suggest_one.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				}
			});
		});

		document.getElementById("setting").addEventListener('tap', function() {
			mui.openWindow({
				url: '../set/set_detail.html',
				id: 'set/set_detail.html',
				show: {
					autoShow: false, //页面loaded事件发生后自动显示，默认为true
					event: 'loaded' //页面显示时机，默认为titleUpdate事件时显示
				},
				waiting: {
					autoShow: true //自动显示等待框，默认为true
				}
			});
		});

		function closeApp() {
			plus.nativeUI.actionSheet({
				cancel: "取消",
				buttons: [{
					title: "注销当前账号"
				}, {
					title: "直接关闭应用"
				}]
			}, function(e) {
				console.log(e.index)
				var index = e.index;
				switch(index) { //case 0: 取消
					case 1: //
						var phone = localStorage.getItem("PHONE")
						localStorage.clear();
						localStorage.setItem("PHONE", phone)
						plus.runtime.restart();
						break;
					case 2: //
						plus.runtime.quit();
						break;
				}
			});
		};
	</script>

</html>